package com.example.algorithm.service;

import com.example.algorithm.model.TreeNode;
import java.util.List;

/**
 * @author Administrator
 * @date 2024/7/25 19:33
 * @description
 */
public interface TreeService {

    public List<Integer> inorderTraversal(TreeNode root);

    public int maxDepth(TreeNode root);

    public TreeNode invertTree(TreeNode root);

    public boolean isSymmetric(TreeNode root);

    public int diameterOfBinaryTree(TreeNode root);

    public List<List<Integer>> levelOrder(TreeNode root);

    public TreeNode sortedArrayToBST(int[] nums);

    public boolean isValidBST(TreeNode root);

    public int kthSmallest(TreeNode root, int k);

    public List<Integer> rightSideView(TreeNode root);

    public void flatten(TreeNode root);

    public TreeNode buildTree(int[] preorder, int[] inorder);

    public int pathSum(TreeNode root, int targetSum);

    public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q);

    public int maxPathSum(TreeNode root);
}
